<template>
	<view>
		<view class="bj">
			<u-navbar title="团购优惠" :autoBack="true" bgColor="#3284fc"
				titleStyle="font-size:18px; color:white;height:44px;line-height:44px" leftIconColor="#fff">
			</u-navbar>
			<view style="margin-top: 50px;">
				<u-cell-group :border="false" v-for="(item,index) in activeList" :key="index" 
					:customStyle="{backgroundColor:'#ffffff',borderRadius:'10px',margin:'10px auto',width:'350px'}">
					<navigator @click="xq(item.id)">
						<image :src="item.photo"></image>
						
						<u-cell :isLink="true" style="margin-top: -15px;">
							<template v-slot:value>
								<span style="color: #a9a9a9; font-size:14px;margin: -2px -2px 0 0;">详情</span>
							</template>
							<template v-slot:title>
								<span style="margin: -2px 140px 0 0;">
									<u--text :lines="1" size="14" :text="item.title"></u--text>
								</span>
							</template>
						</u-cell>
					</navigator>
				</u-cell-group>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				queryParams: {
					pageNum: 1,
					pageSize: 10,
					title: null,
					shopId: null,
					type: null,
					auditTime: null,
					state: null,
				},
				activeList:[]
			}
		},
		onLoad() {
			this.getActiveList()
		},
		methods: {
			xq(id) {
				uni.navigateTo({
					url: '/pages/refuel/discount_xq/discount_xq?id='+id
				})
			},
			getActiveList() {
				let that = this;
				this.$http({
					url: 'api/activity/activity/list',
					method: 'GET',
					data:that.queryParams,
					success(res){
						console.log(res)
						that.activeList=res.data.rows
						// console.log(res.data.rows)
					}
				})
			}
		}
	}
</script>

<style scoped>
	image {
		width: 320px;
		height: 195px;
		margin: 15px 15px;
		border-radius: 10px;
	}

	.bj {
		width: 100%;
		height: 220px;
		background-color: #3384fc;
	}
</style>